<template>
	<view class="zuji">
		<view class="zuji_tops">
			<view class="zuji_top">
				<text>近一周浏览的商品</text>
			</view>
		</view>
		<u-empty :show='onshou' mode="history" icon="http://cdn.uviewui.com/uview/empty/car.png">
		</u-empty>
		<view class="zuji_list">
			<view class="zuiji_list_data" style="  width: 100%;">
				<view v-for="item in datalist"
					style="background-color: #FFFFFF; min-height: 192px; min-width: 130px; width: 30%;margin: 10px; border-radius: 5px; float: left;">
					<image @click="toxiangqing(item)" style="width: 100%;height: 105px; border-radius: 5px 5px 0 0;"
						:src="item.logo" mode="">
					</image>
					<view style="margin: 5px 0 5px 0; height: 47px; overflow: hidden;">
						<text style="font-size: 13px;">{{item.title}}</text>
					</view>
					<view style="margin: 5px 0 5px 0;">
						<text style="color: red;">￥</text><text
							style="font-size: 20px; color: red;">{{item.price}}</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				onshou: true,
				datalist: []
			}
		},
		onLoad() {

		},
		onShow() {
			this.logd()
		},
		methods: {
			del() {
				this.datalist = []
				this.onshou = true
			},

			onlist() {
				if (this.datalist.length != 0) {
					this.onshou = false
				}
			},
			toxiangqing(item) {
				uni.navigateTo({
					url: "../xiangqing/xiangqing?item=" + encodeURIComponent(JSON.stringify(item)),
				})
			},
			logd() {
				var this_ = this
				this.$http.getaddzj().then(res => {
					if (res.data.length != 0) {
						this_.onshou = false
					}
					
					this_.datalist = res.data
					
				})
			}
		}
	}
</script>

<style>
	@font-face {
		font-family: 'iconfont';
		/* Project id 3183672 */
		src: url('//at.alicdn.com/t/font_3183672_gb2l0tjy5ek.woff2?t=1651211836866') format('woff2'),
			url('//at.alicdn.com/t/font_3183672_gb2l0tjy5ek.woff?t=1651211836866') format('woff'),
			url('//at.alicdn.com/t/font_3183672_gb2l0tjy5ek.ttf?t=1651211836866') format('truetype');
	}

	.iconfont {
		font-family: "iconfont" !important;
		font-size: 25px;
		font-style: normal;
		-webkit-font-smoothing: antialiased;
		-webkit-text-stroke-width: 0.2px;
		-moz-osx-font-smoothing: grayscale;
	}

	.zuji {
		background-color: #f7f7f7;
		width: 100%;
		height: 100%;
		position: relative;
	}

	.zuji_list {
		overflow-y: scroll;
		background-color: #f7f7f7;
		padding: 10px;
		width: 100%;
		height: 100%;
		width: 100%;
	}

	.zuji_top {
		display: flex;
		justify-content: space-between;
		padding: 0 20px 0 20px;
	}

	.zuji_tops {
		display: flex;
		justify-content: center;
		flex-direction: column;
		background-color: #FFFFFF;
		height: 45px;
		font-size: 13px;
		font-weight: 400;
	}
</style>
